import React, { Component } from "react";
import Search from './components/Search'
import List from './components/List'
import './App.css'

export default class App extends Component {
  state = {
    users: [], //初始化状态
    isFirst: true, //users初始值为数组
    isLoading: false, //标识是否处于加载中
    err: '' //存储请求相关的错误信息
  }
  //更新App的state
  udpateStateObj = (stateObj)=>{
    this.setState(stateObj)
  }
  render() {
    return (
      <div className="container">
        <Search udpateStateObj={this.udpateStateObj}/>
        <List {...this.state}/>
      </div>
    );
  }
}
